﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using MB=Manager.BLL;
using MM = Manager.Model;
using Webdiyer.WebControls.Mvc;

namespace Web.Controllers
{
    public class StylistController : Controller
    {
        private readonly MB.Admin.M_StylistBll bllStylist = new MB.Admin.M_StylistBll();
        //
        // GET: /Stylist/

        public ActionResult Index(int? id,int? page)
        {
            int stylistid = id ?? 0;
            if (bllStylist.Exists(stylistid))
            {
                MB.Admin.M_OpusBll bllOpus = new MB.Admin.M_OpusBll();
                PagedList<MM.Admin.M_Opus> opuss = new PagedList<MM.Admin.M_Opus>(bllOpus.GetModelList("IsValid=1 And OpusStylistID=" + id + "Order By OpusID Desc"),page??1,10);
                ViewBag.OpusList = opuss;
                return View(bllStylist.GetModel(stylistid));
            }else
                return View();
        }
        /// <summary>
        /// 查看设计师作品明细
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public ActionResult Details(int? id)
        {
            MB.Admin.M_OpusBll bllOpus = new MB.Admin.M_OpusBll();
            int opusid = id ?? 0;
            if (bllOpus.Exists(opusid))
            {
                return View(bllOpus.GetModel(opusid));
            }
            else
                return View();
        }
    }
}
